package com.example.demo.service.imp;

import com.example.demo.pojo.TFChoice;
import com.example.demo.mapper.TFChoiceMapper;
import com.example.demo.service.TFChoiceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class TFChoiceServiceImp implements TFChoiceService {

    @Autowired
    private TFChoiceMapper tfChoiceMapper;

    @Override
    public List<TFChoice> getAll() {
        return tfChoiceMapper.queryTFChoiceList();
    }

    @Override
    public TFChoice getById(Integer id) {
        return tfChoiceMapper.getById(id);
    }

    @Transactional
    @Override
    public void add(TFChoice tfChoice) {
        tfChoiceMapper.add(tfChoice);
    }

    @Transactional
    @Override
    public void delete(Integer id) {
        tfChoiceMapper.delete(id);
    }
}
